package demo1;

import java.util.*;

public class Main {

    public static void main(String[] args) {
//        Scanner in = new Scanner(System.in);
//        char[] s = in.next().toCharArray();
        char[] s = new char[]{'m','e','o','w'};

        int len = 0;
        for(int i = 0; i < s.length; i++){
            int left = i, right = i;
            while(left != -1 && right != s.length && s[left] != s[right]){
                left--;
                right++;
            }
            if(right - left - 1 > len){
                len = right - left - 1;
            }

            left = i;
            right = i + 1;
            while(left != -1 && right != s.length && s[left] != s[right]){
                left--;
                right++;
            }
            if(right - left - 1 > len){
                len = right - left - 1;
            }
        }
        System.out.println(len);
    }
}
